import Main from '@/components/main'
import ToolMain from '@/components/tool-main'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

export default [
  {
    path: '/',
    name: '_databook',
    redirect: '/databook/databook_page',
    meta: {
      hideInMenu: true,
      notCache: true
    }
  },
  {
    path: '/databook',
    name: 'databook',
    component: Main,
    meta: {
      hideInMenu: true
    },
    children: [
      {
        path: 'databook_page',
        name: 'databook_page',
        meta: {
          title: '数据本'
        },
        component: () => import('@/view/databook/databook.vue')
      }
    ]
  },
  {
    path: '/webview',
    name: 'webview',
    component: Main,
    meta: {
      hideInMenu: true
    },
    children: [
      {
        path: 'webview_page',
        name: 'webview_page',
        meta: {
          title: '浏览器'
        },
        component: () => import('@/view/webview/webview.vue')
      }
    ]
  },
  {
    path: '/tool',
    name: 'tool',
    component: Main,
    meta: {
      hideInMenu: true
    },
    children: [
      {
        path: 'tool_page',
        name: 'tool_page',
        component: ToolMain,
        meta: {
          hideInMenu: true
        },
        children: [
          {
            path: 'sitdown',
            name: 'sitdown',
            meta: {
              title: 'Sitdown'
            },
            component: () => import('@/view/tool/sitdown.vue')
          },
          {
            path: 'markdown-nice',
            name: 'markdown-nice',
            meta: {
              title: 'Markdown Nice'
            },
            component: () => import('@/view/tool/markdown-nice.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/webspider',
    name: 'webspider',
    component: Main,
    meta: {
      hideInMenu: true
    },
    children: [
      {
        path: 'webspider_page',
        name: 'webspider_page',
        meta: {
          title: '智能爬虫'
        },
        component: () => import('@/view/webspider/webspider.vue')
      }
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
